<template>
  <view class="bjys2">
    <view class="title">
      修改密码
    </view>
    <view class="u_collect_inp">
      <image class="u_img" src="@/static/img/pass.png" mode=""></image>
      <input type="password" maxlength="12" placeholder="请输入原密码(6-12位英文或数字)" v-model="password1" />
    </view>
    <view class="u_collect_inp">
      <image class="u_img" src="@/static/img/pass.png" mode=""></image>
      <input type="password" maxlength="12" placeholder="请输入新密码(6-12位英文或数字)" v-model="password2" />
    </view>
    <view class="u_collect_inp">
      <image class="u_img" src="@/static/img/pass.png" mode=""></image>
      <input type="password" maxlength="12" placeholder="确认密码(6-12位英文或数字)" v-model="password3" />
    </view>
    <view class="button" @click="submit">提交</view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        password1: '',
        password2: '',
        password3: '',
      }
    },
    methods: {
      submit() {
        this.$http.editpass({
          id: uni.getStorageSync('token'),
          p: this.password1,
          p1: this.password2,
          p2: this.password3,
        }).then(res => {
          if (res.code == 200) {
            this.$toast('修改成功')
          } else {
            this.$toast(res.msg)
          }
        })
      }

    },
    onLoad() {

    }
  }
</script>

<style lang="less">
  .bjys2 {
    padding-top: 50rpx;
    padding-bottom: 20rpx;
    height: 150rpx;
    width: 750rpx;
    top: 0;
    position: absolute;
    width: 100%;
    background: linear-gradient(90deg, #bdc3c7, #2c3e50);
    border-bottom-right-radius: 30rpx;
    border-bottom-left-radius: 30rpx;

    .title {
      margin-bottom: 30rpx;
      position: relative;
      font-size: 32rpx;
      text-align: center;
      color: #FFFFFF;

      image {
        position: absolute;
        right: 30rpx;
        width: 40rpx;
        height: 40rpx;
      }
    }

    .u_collect_inp {
      position: relative;
      padding-left: 20rpx;
      display: flex;
      height: 80rpx;
      justify-content: flex-start;
      align-items: center;
      background-color: #fff;
      padding-bottom: 10rpx;
      border-bottom: 1rpx solid #eff9ff;

      input {
        width: 450rpx;
      }

      .u_img {
        margin-right: 15rpx;
        width: 44rpx;
        height: 40rpx;
      }

      .button {
        position: absolute;
        right: 25rpx;
        width: 160rpx;
        height: 80rpx;
        color: #fff;
        font-size: 28rpx;
        background: #ccc;
        line-height: 80rpx;
        border-radius: 40rpx;
        text-align: center;
      }

    }
  }

  .button {
    margin-top: 20rpx;
    width: 95%;
    margin: auto;
    height: 80rpx;
    border-radius: 20rpx;
    text-align: center;
    font-size: 32rpx;
    line-height: 1;
    color: #fff;
    line-height: 80rpx;
    background: #4a4c5b;
  }
</style>
